import request from '@/utils/request'

export function getUserList(params) {
  return request({
    url: 'user/getUserListByOrgType',
    method: 'get',
    params: params
  })
}

export function updateState(userId, data) {
  return request({
    url: 'user/updateUserState/' + userId,
    method: 'put',
    data
  })
}

export function queryUserByUserId(userId) {
  return request({
    url: 'user/queryUserByUserId/' + userId,
    method: 'get'
  })
}

export function addUser(data) {
  return request({
    url: 'user/addUser',
    method: 'post',
    data
  })
}

export function getResourceList() {
  return request({
    url: 'user/getResourceList',
    method: 'get'
  })
}

export function checkUserName(userName, id) {
  return request({
    url: 'user/checkUserName/' + userName,
    method: 'get',
    params: id
  })
}

export function updateUserByUserId(userId, data) {
  return request({
    url: 'user/updateUserByUserId/' + userId,
    method: 'put',
    data
  })
}
